#include <iostream>
#include "vectorfunctions.h"

void factoriprimi(int x[], int l)
{
	int i, j, div, n, nr;
	for(i=0;i<l;i++){
		n=x[i];
		div=2;
		cout<<x[i]<<"= ";
		while(n!=1){
			if(n%div==0){
				nr=0;
				cout<<div<<"^";
				while(n%div==0){
					n/= div;
					++nr;
				}
				cout<<nr<<" ";
			}
			++div;
		}
		cout<<"\n";
			
	}
		
}

int main()
{
	int l;
	int x[100];
	cout<<"Length of array : ";
	cin>>l;
	readVector(x, l);
	factoriprimi(x, l);

return 0;
}
